<div class="dux-page-header uk-clearfix">
    <div class="page-title">
        <a class="uk-button uk-button-primary" href="{url('index')}"> 节点列表</a>
    </div>
    <div class="page-action">
        <a class="uk-button uk-button-danger" href="javascript:location.reload();"><i class="fa fa-refresh"></i></a>
    </div>
</div>
<div>
    <div class="uk-card uk-card-default uk-card-small dux-panel">
        <div class="uk-card-header">{$assignName}节点</div>
        <div class="uk-card-body">
            <form class="uk-form  uk-form-horizontal dux-form" data-dux="form-bind" method="post">
                <fieldset>
                    <div class="uk-form-group">
                        <label class="uk-form-label">节点分组</label>
                        <div class="uk-form-controls">
                            <select name="group_id" class="uk-form-field" data-am-selected="{btnWidth: '100%'}" required>
                                <!--loop{$groupList as $vo}-->
                                <option value="{$vo.group_id}"
                                <!--if{ $vo['group_id'] == $info['group_id'] }--> selected <!--{/if}-->
                                >{$vo.name}</option>
                                <!--{/loop}-->
                            </select>
                        </div>
                    </div>
                    <div class="uk-form-group">
                        <label class="uk-form-label">节点名</label>
                        <div class="uk-form-controls">
                            <input type="text" name="name" value="{$info.name}" placeholder="请输入节点名" minlength="3" maxlength="20" required>
                        </div>
                    </div>
                    <!--if{$typeList}-->
                    <div class="uk-form-group">
                        <label class="uk-form-label">节点类型</label>
                        <div class="uk-form-controls">
                            <select name="type">
                                <!--loop{$typeList as $key => $vo}-->
                                <option value="{$key}">{$vo.name}</option>
                                <!--{/loop}-->
                            </select>
                            <div class="uk-form-help">添加后无法进行类型更改</div>
                        </div>
                    </div>
                    <!--{else}-->
                    <div class="uk-form-group">
                        <label class="uk-form-label">节点类型</label>
                        <div class="uk-form-controls uk-form-content">
                            {$info.type}
                            <div class="uk-form-help">无法进行类型更改</div>
                        </div>
                    </div>
                    <!--{/if}-->
                    <div class="uk-form-group">
                        <label class="uk-form-label">图标</label>
                        <div class="uk-form-controls">
                            <!--if{$info.icon}-->
                            <div class="am-margin-bottom" style="">
                                <img src="{$info.icon}" class="am-img-thumbnail" width="200"  alt=""/>
                            </div>
                            <!--{/if}-->
                            <div class="uk-input-group">
                                <input type="text" class="uk-form-field" name="icon" id="icon" value="{$info.icon}"
                                       placeholder="可选,上传节点图标">
                                <span class="uk-input-group-btn">
                                            <button class="uk-button uk-button-default" type="button" data-dux="form-upload"
                                                    data-target="#icon" data-type="jpg,png,bmp"><i
                                                    class="fa fa-upload"></i></button>
                                        </span>
                            </div>
                        </div>
                    </div>
                    <div class="uk-form-group">
                        <label class="uk-form-label">节点介绍</label>
                        <div class="uk-form-controls">
                            <textarea name="description" placeholder="请输入节点介绍" required>{$info.description}</textarea>
                        </div>
                    </div>
                    <div class="uk-form-group">
                        <label class="uk-form-label">版主</label>
                        <div class="uk-form-controls">
                            <select data-dux="form-select" name="moderator[]" multiple data-placeholder="输入用户信息查找" data-user="true" data-url='{url("topics/User/ajaxList")}'>
                                <!--loop{$userList as $vo}-->
                                <option selected value="{$vo.user_id}">{$vo.show_name}</option>
                                <!--{/loop}-->
                            </select>
                        </div>
                    </div>
                    <div class="uk-form-group">
                        <label class="uk-form-label">排序</label>
                        <div class="uk-form-controls">
                            <input type="number" name="sort" value="{$info.sort?$info.sort:0}" placeholder="请输入顺序" >
                        </div>
                    </div>
                    <div class="uk-form-group">
                        <label class="uk-form-label">可发布角色</label>
                        <div class="uk-form-controls">
                            <select name="post_role[]" data-dux="form-chosen" multiple data-placeholder="请选择可发帖角色">
                                <!--loop{$roleList as $vo}-->
                                <!--if{in_array($vo.role_id, $postRole)}-->
                                <option value="{$vo.role_id}" selected>
                                <!--{else}-->
                                <option value="{$vo.role_id}">
                                <!--{/if}-->
                                    {$vo.name}</option>
                                <!--{/loop}-->
                            </select>
                        </div>
                    </div>
                    <div class="uk-form-group">
                        <div class="am-u-sm-offset-12 am-u-md-offset-2">
                            <input type="hidden" name="node_id" value="{$info.node_id}">
                            <button class="uk-button uk-button-primary" type="submit" disabled>保存</button>
                        </div>
                    </div>
                </fieldset>
            </form>
        </div>
    </div>
</div>